using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LevelSelector : MonoBehaviour
{
    [Header("1-3")]
    public List<LevelData> levelPool1 = new List<LevelData>();
    public List<LevelData> levelPool2 = new List<LevelData>();
    public List<LevelData> levelPool3 = new List<LevelData>();

    [Header("4-7")]
    public List<LevelData> levelPool4 = new List<LevelData>();
    public List<LevelData> levelPool5 = new List<LevelData>();
    public List<LevelData> levelPool6 = new List<LevelData>();
    public List<LevelData> levelPool7 = new List<LevelData>();

    [Header("8-10")]
    public List<LevelData> levelPool8 = new List<LevelData>();
    public List<LevelData> levelPool9 = new List<LevelData>();
    public List<LevelData> levelPool10 = new List<LevelData>();

    public LevelData SelectorLevel(int levelPool)
    {
        var pool = GetPool(levelPool);
        if(pool == null)
            return null;
        
        int index = Random.Range(0,pool.Count);
        return pool[index];
    }

    public List<LevelData> GetPool(int level)
    {
        switch (level)
        {
            case 1:
                return levelPool1;
            case 2:
                return levelPool2;
            case 3:
                return levelPool3;
            case 4:
                return levelPool4;
            case 5:
                return levelPool5;
            case 6:
                return levelPool6;
            case 7:
                return levelPool7;
            case 8:
                return levelPool8;
            case 9:
                return levelPool9;
            case 10:
                return levelPool10;
            default:
                return null;

        }
    }

}
